Carbon


SetDefaultOutputVolume

Header: Sound.h Carbon status: Supported

Sets the default volume of a sound output device.

OSErr SetDefaultOutputVolume (
    SInt32 level
);
Parameter descriptions
level

The desired default volume level of a sound output device.

function result

A result code.

DISCUSSION

With this function, you specify a volume with a 16-bit value, where 0 represents no volume (that is, silence) and 256 (hexadecimal $0100) represents full volume. The right and left volumes of a stereo sound are encoded as the high word and the low word, respectively, of a 32-bit value. Moreover, it’s possible to overdrive a particular volume level if you need to amplify a low signal. For example, the long word $02000200 specifies a volume level of twice full volume on both the left and right channels of a stereo sound.

SPECIAL CONSIDERATIONS

You can call this function at interrupt time.

VERSION NOTES

The SetDefaultOutputVolume function is available only in versions 3.0 and later of the Sound Manager.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)